import request from '@/utils/request'
/**
 * 查看月卡信息列表
 * @param {*} params
 * @returns
 */

// 获取月卡信息列表
export const getCardListAPI = params => {
  return request({
    url: '/parking/card/list',
    method: 'get',
    params
  })
}

// 添加月卡信息
export const addMonthCardAPI = data => {
  return request({
    url: 'parking/card',
    method: 'post',
    data
  })
}

// 编辑月卡数据详情
export const getCardDetailAPI = id => {
  return request({
    url: `/parking/card/detail/${id}`,
    method: 'get',
    id
  })
}

// 编辑月卡
export const editMonthCardAPI = data => {
  return request({
    url: '/parking/card/edit',
    method: 'put',
    data
  })
}

// 删除月卡信息
export const deleteCardAPI = ids => {
  return request({
    url: `/parking/card/${ids}`,
    method: 'delete',
    ids
  })
}

// 批量删除月卡信息
export const deleteCardBatchAPI = idlist => {
  return request({
    url: `/parking/card/${idlist.join(',')
    }`,
    method: 'delete',
    idlist
  })
}
